package com.chen.project.white_jotter.controller;


import com.chen.project.white_jotter.pojo.AdminRole;
import com.chen.project.white_jotter.result.Result;
import com.chen.project.white_jotter.service.admin.RoleService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/api/admin")
public class AdminRoleController {

    @Resource
    private RoleService roleService;

    @GetMapping("/role")
    public Result getRoleList(){
        List<AdminRole> roleList = roleService.getRoleList();
        return new Result(200, "获取角色列表成功", roleList);
    }


}
